package Operation;

import Book.BookList;

import java.util.Scanner;

public class Find implements IOperation{
    @Override
    public void work(BookList bookList) {
        System.out.println("查找图书！");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        int ret = bookList.getUsedSize();
        for (int i = 0; i < ret; i++) {
            if(name.equals(bookList.getBook(i).getName())){
                System.out.println(bookList.getBook(i));
                return;
            }
        }
        System.out.println("没有该书！");
    }
}
